package com.wsc.controller;

import org.apache.shiro.authz.AuthorizationException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class ExceptionController {
    /**
     * 处理没有授权异常
     * @return  异常描述
     */
    @ExceptionHandler(AuthorizationException.class)
    @ResponseBody
    public String noAuthorize(){
        return "统一异常处理-------->当前用户没有权限";
    }
}
